<template>
    <scroll-view class="content">
        <div
            v-for="(item, index) in activities"
            :key="index"
            style="padding-top: 10px; padding-bottom: 10px"
        >
            <div @click="toActivityDetail(item)">
                <HomeActivityCard
                    :key="index"
                    :status="item.status"
                    :title="item.title"
                    :time="item.time"
                    :activity-mage="item.image"
                ></HomeActivityCard>
            </div>
        </div>
    </scroll-view>
</template>

<script lang="ts" setup>
import { ref, defineProps, defineComponent } from 'vue'

import HomeActivityCard from '@/components/home/home-activity-card.vue'
import ShareType from '@/activityPages/const/share'
const props = defineProps(['title', 'sub', 'moreLink'])
const tabIndex = ref(0)
const q = ref('')
const tabs = ['进行中', '已结束']
console.log('this.tabs', tabs)
function toActivityDetail(item) {
    const title = item.title
    console.log('toMyActivity')
    if (title.indexOf(ShareType.common) > -1) {
        uni.navigateTo({
            url: `/activityPages/office-share/space-detail?type=${ShareType.common}`
        })
    } else if (title.indexOf(ShareType.meetingRoom) > -1) {
        uni.navigateTo({
            url: `/activityPages/office-share/space-detail?type=${ShareType.meetingRoom}`
        })
    }
}

const activities = ref([
    {
        title: ShareType.common,
        image: 'https://img.zcool.cn/community/012e285a1ea496a8012171323c6bf1.jpg@3000w_1l_0o_100sh.jpg',
        time: '2023-05-05',
        id: '113',
        status: 2
    },
    {
        title: `共享${ShareType.meetingRoom}`,
        image: 'https://img.zcool.cn/community/012e285a1ea496a8012171323c6bf1.jpg@3000w_1l_0o_100sh.jpg',
        time: '2023-05-05',
        id: '123213',
        status: 2
    },
    {
        title: ShareType.gym,
        image: 'https://img.zcool.cn/community/012e285a1ea496a8012171323c6bf1.jpg@3000w_1l_0o_100sh.jpg',
        time: '2023-05-05',
        id: '111313',
        status: 2
    }
])
function onTapTabAt(i) {
    tabIndex.value = i
}
function toMyActivity(item) {}
</script>

<style scoped>
.content {
    background-color: rgba(245, 245, 245, 1);
}
.couponsCount {
    height: 20px;
    line-height: 20px;
    color: rgba(153, 153, 153, 1);
    font-size: 14px;
    text-align: left;
    font-family: PingFangSC-regular;
}
.icon {
    width: 20px;
    height: 20px;
}
</style>
